// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

//!DESC NNEDI3 (double_y, nns16, win8x6)
//!HOOK LUMA
//!BIND HOOKED
//!SAVE nnedi3_int
//!WHEN HOOKED.h OUTPUT.h / 0.833333 <
float nnedi3(vec4 samples[12]) {
float sum = 0.0, sumsq = 0.0;
for (int i = 0; i < 12; i++) {
    sum += dot(samples[i], vec4(1.0));
    sumsq += dot(samples[i], samples[i]);
}
float mstd0 = sum / 48.0;
float mstd1 = sumsq / 48.0 - mstd0 * mstd0;
float mstd2 = mix(0.0, inversesqrt(mstd1), mstd1 >= 1.192092896e-7);
mstd1 *= mstd2;
float vsum = 0.0, wsum = 0.0, sum1, sum2;
#define T(x) intBitsToFloat(x)
#define W(i,w0,w1,w2,w3) dot(samples[i],vec4(T(w0),T(w1),T(w2),T(w3)))
#define WS(w0,w1) sum1 = exp(sum1 * mstd2 + T(w0)); sum2 = sum2 * mstd2 + T(w1); wsum += sum1; vsum += sum1*(sum2/(1.0+abs(sum2)));
sum1=W(0,1027745880,-1121396864,-1130469888,-1126897990)+W(1,1024642508,-1107295041,1039079928,1024250604)+W(2,-1149906049,-1126556538,-1147395201,-1121959908)+W(3,1041026790,1042195560,-1116173177,-1113607518)+W(4,1044630722,999141354,-1098313415,1022159130)+W(5,1005058137,1007702352,1019497054,-1107136294)+W(6,1018714920,1026239260,-1133977224,1015526727)+W(7,-1106681307,1038936227,-1106606352,1042189511)+W(8,-1121374916,1025050132,-1124106064,1035880216)+W(9,-1131068140,1015308851,-1122292152,990390561)+W(10,-1122507740,1031978820,-1122039043,1013770942)+W(11,-1135809122,1018900008,-1116330759,-1136584888);sum2=W(0,1011515348,1029416248,1023321012,1017133506)+W(1,-1123730089,1020129658,-1115999672,-1139818306)+W(2,-1138856554,1007066512,1015618084,996184056)+W(3,1057587887,1071604647,-1112177411,-1119553894)+W(4,-1109933138,-1097028615,-1079392139,-1090489276)+W(5,-1145378916,1008681896,1028448562,1016266760)+W(6,1051025857,1035052104,-1133574805,-1165256880)+W(7,-1105405946,-1135392452,-1139515542,-1098617840)+W(8,1000343320,991053648,-1138601606,-1155286464)+W(9,1010374724,1018728192,-1135761830,1020043526)+W(10,-1142174380,1002597928,1024878156,-1121583660)+W(11,-1155288808,-1132781834,-1131188096,997185888);WS(1018288640,1027735986);
sum1=W(0,-1178449286,-1114624234,1006778572,1012158232)+W(1,-1128542910,1027108853,1032943202,1044498160)+W(2,1002517720,964628492,1017365062,-1115962871)+W(3,-1104570115,1028919475,-1156175041,1025063871)+W(4,-1088743921,-1106124541,-1097612337,1059928494)+W(5,-1134936888,-1146238776,1026836706,1032615126)+W(6,1034856692,-1127457566,-1140348884,1010747802)+W(7,1059914122,1032056909,1031833306,-1085331503)+W(8,1020458158,1016604174,-1122073627,-1114177498)+W(9,-1122825993,-1115773453,-1172026051,1020162890)+W(10,1033999672,1027508251,1038136595,-1119592595)+W(11,998219705,1023799671,-1129465364,1022377282);sum2=W(0,-1130460798,985194115,-1145399745,-1126840972)+W(1,1017322604,-1129997452,-1120812206,1019075916)+W(2,-1131047996,-1143360737,1006903064,-1131054760)+W(3,-1112997847,-1120456092,991527106,-1139273136)+W(4,1042717692,1051048254,1043975251,-1139625904)+W(5,-1130986946,1007107280,-1113881740,-1114175000)+W(6,1001121889,1017866680,-1139461992,-1135317632)+W(7,-1121880440,-1112673669,-1128878392,-1150833602)+W(8,-1143215153,-1125685806,1026044394,978663174)+W(9,1006765920,1000306721,995542402,-1129486378)+W(10,-1126929736,-1114488494,-1142139489,-1133504840)+W(11,-1144361281,-1134951296,1007041936,1014584312);WS(1042433344,-1111851638);
sum1=W(0,-1112658226,-1123380939,-1139940268,-1128612156)+W(1,1043958886,1033805831,-1126908022,-1119638967)+W(2,-1128976934,-1142120768,-1115346894,-1120465263)+W(3,-1128727592,-1107767030,984858240,-1122042583)+W(4,1057665642,1046318672,1052387104,-1097703246)+W(5,1005565040,-1148354296,-1108167869,-1104545545)+W(6,-1114896432,-1115281716,-1146630760,999630836)+W(7,-1095395475,-1117224401,1030603948,1054789077)+W(8,-1133849404,-1117808895,-1163176544,1029397739)+W(9,-1129996802,-1123547845,996431920,-1126512698)+W(10,-1123618471,-1113258842,1026334318,1028419819)+W(11,1013349902,-1120421311,-1134051464,-1117439993);sum2=W(0,-1109389142,-1119299282,-1132240188,1022431497)+W(1,1028727631,-1129989652,-1139248009,1004613154)+W(2,-1132574761,-1114039002,-1140046689,1029503922)+W(3,-1107432916,1044244351,-1114822837,1024165374)+W(4,1047487962,-1100679909,-1108646182,1041447926)+W(5,-1135952741,-1123756570,1040665470,1017218352)+W(6,1031006195,983982854,-1124855948,-1120729932)+W(7,-1126089152,1033956847,1009435309,1047688354)+W(8,-1148002498,1028342876,-1107003694,-1120804126)+W(9,-1158996358,-1121099750,-1128289576,-1126342960)+W(10,-1123334894,1039673953,1036127241,-1122846542)+W(11,-1117057946,1026336008,-1102421772,-1140927562);WS(1015433728,1058400049);
sum1=W(0,1031161269,1032977294,-1133909491,-1139873791)+W(1,1033801204,-1131731326,-1112917766,-1113693508)+W(2,-1143910182,1019358132,989007258,-1119172737)+W(3,-1116372870,1035249566,-1230944644,1023506921)+W(4,1045725159,-1102794347,-1103376612,-1116140698)+W(5,1008313039,-1115540344,1044071755,-1122523445)+W(6,-1120831281,-1114963068,1028378783,-1118840528)+W(7,-1116748777,1032646513,-1141442286,1044830734)+W(8,-1126204226,-1118552369,1018738506,1030473357)+W(9,1032892305,-1105610222,1033465034,-1121050287)+W(10,-1112562780,1030129285,1034039600,1023234585)+W(11,1016154651,-1124368226,-1122899972,1021910870);sum2=W(0,-1158711528,1013039401,992976916,-1138428449)+W(1,-1140697417,-1123518198,-1130455464,-1124467432)+W(2,1012442941,975746961,1033499227,1030243467)+W(3,-1128734961,1036130613,976851025,-1142924106)+W(4,-1099387353,-1077268149,-1097860430,-1113146735)+W(5,-1122081826,-1117904739,1072898808,1051222006)+W(6,1010050489,-1137359275,997652548,989093448)+W(7,-1091225653,1032494444,-1122996798,-1108810723)+W(8,-1131990027,951236744,1025590581,1056060393)+W(9,990210276,-1138876101,-1134977059,-1153131756)+W(10,-1115493835,1018469149,-1127238416,-1140348735)+W(11,1006284898,-1146863422,1026307569,1025171621);WS(-1143089152,1030017260);
sum1=W(0,-1116644609,-1127223379,1001605962,1012276081)+W(1,-1124688427,1035777366,-1119160665,1019444907)+W(2,-1130860131,-1130309965,-1136557285,1029853709)+W(3,-1109637089,-1115433381,-1155861797,1024406997)+W(4,-1098625404,1006101820,1044433671,1048989101)+W(5,-1130883561,1009046005,-1111190908,1038057505)+W(6,1036571679,1028189701,-1122534699,-1155627981)+W(7,1048780603,-1104960796,1039597237,-1098184025)+W(8,1025361773,1018788475,-1130076067,-1112291813)+W(9,-1126280255,1036379833,-1120990241,1018348791)+W(10,1029641477,-1111599465,-1136463217,-1117935161)+W(11,-1125993892,1020397819,-1154886405,1012573277);sum2=W(0,1008405084,985822624,-1147284080,-1153319600)+W(1,-1140784820,-1129308604,1010505984,-1118973116)+W(2,1010769460,1001814848,1021293048,1012585128)+W(3,-1142311064,1022276922,995456320,1008968960)+W(4,1037448945,1057794596,-1089187936,-1101248908)+W(5,-1160749952,-1123619202,1033366347,1024969278)+W(6,-1140411728,1005012008,-1146954776,-1140178660)+W(7,1029773785,1015531414,1017518401,-1109859050)+W(8,-1136545168,1000322872,1007802556,1024400778)+W(9,1003782736,1006946188,-1170856127,-1142030464)+W(10,974134143,960534268,995727232,982409184)+W(11,-1152799248,985284128,1009923956,1003482728);WS(1064472528,-1121594920);
sum1=W(0,1027230343,1032290711,-1143599223,-1142654991)+W(1,1027061019,1016010466,-1113392623,-1112807213)+W(2,-1164359388,1014490160,991342574,-1128825126)+W(3,-1136037408,1002050167,1010500896,1014568428)+W(4,1034098395,-1112872467,-1113734161,-1115590690)+W(5,-1148094031,-1127829894,1027642302,1008695068)+W(6,-1122938499,-1120250507,1020884834,-1124387333)+W(7,-1130883382,1015162858,1029912912,1038834309)+W(8,-1138058188,-1124941766,1015817710,1013984188)+W(9,1025589157,-1110863224,1026841191,-1131205634)+W(10,-1123484555,1019435182,1031947569,1019867389)+W(11,1008886302,-1130075526,-1129521612,1015459258);sum2=W(0,-1154115373,-1139843175,-1147429191,1003807591)+W(1,1017182228,1024488826,1001833687,1000124719)+W(2,-1130234859,987658746,-1116401990,-1126980607)+W(3,1018649088,1016729308,-1132089351,1002635095)+W(4,1040714709,1063780536,-1105992985,1008095031)+W(5,1013729967,1024604622,-1085442794,-1105844805)+W(6,1024344696,-1155997437,-1151072125,-1147602519)+W(7,1047200342,1020609216,-1132427785,1014141127)+W(8,995366957,-1147894927,-1122913939,-1101306502)+W(9,1001714367,-1141691791,1011860423,964968041)+W(10,1023684454,1017456200,-1139390003,-1141957575)+W(11,-1146690231,-1146063807,-1128761080,-1125194898);WS(1061878800,-1131153991);
sum1=W(0,1015115512,1031144036,1018625288,-1123872727)+W(1,1041224340,1009910425,-1102371221,-1099302516)+W(2,-1171049230,1022902338,1014687697,-1144166978)+W(3,1036357847,-1108974562,1026350045,-1127640224)+W(4,1052022073,1058525661,1059569738,-1085394744)+W(5,-1132534141,1016189168,-1125187302,-1115552350)+W(6,-1107191102,1006433282,1018183052,1013916191)+W(7,-1088226291,-1097316565,1032504563,1050617832)+W(8,-1123531112,-1127405808,1040234099,1037730450)+W(9,1014427177,1026198990,1016048056,-1145362866)+W(10,-1109508096,-1098228398,1033421596,1031877738)+W(11,1018548825,-1137247201,1035235966,1015825508);sum2=W(0,1031269327,-1131640108,973798558,-1131301730)+W(1,-1109842974,-1125259759,1028981651,-1127010401)+W(2,-1180777340,-1160957999,-1167651134,-1181736700)+W(3,1013454096,-1109509101,1013478572,-1127780866)+W(4,-1113692773,1047088883,1051779317,-1149526184)+W(5,993986728,1020962386,-1109788940,-1123287814)+W(6,-1117315078,-1131160392,-1135840779,-1160424319)+W(7,-1134194124,1028175261,-1137527992,1028380081)+W(8,-1136947718,-1138138790,-1121515979,-1115287133)+W(9,-1145619912,-1127332243,-1138738786,-1164912671)+W(10,1018886164,1027237057,-1148504424,998238336)+W(11,-1152989064,-1123011340,-1142455024,-1125209194);WS(-1146021888,1053974589);
sum1=W(0,-1119368753,-1134074211,1013890275,1029642476)+W(1,-1095098901,-1107285127,1042359026,1042969521)+W(2,984849429,-1135393367,1031018217,1046685039)+W(3,1007708103,1017736689,1022266947,-1176939092)+W(4,-1096985546,1034918881,-1101301107,1045769551)+W(5,-1139413615,1024875117,1003810877,1036262392)+W(6,1027345005,1032510570,1004183253,-1146466657)+W(7,1050538529,1051699648,-1091538585,-1094644679)+W(8,-1172526890,1017671961,1011534979,-1120828825)+W(9,1019378973,1031489314,-1127783457,-1160650069)+W(10,1036824506,1048776768,-1095508207,-1107179580)+W(11,-1160823333,1006585957,1035618600,-1133351451);sum2=W(0,-1091101506,1001500224,1030774484,1031363252)+W(1,1057852755,-1132290932,-1110436898,1048232756)+W(2,1016290300,-1126601761,-1131305343,-1095952784)+W(3,-1110787951,965388167,1007437656,1015165558)+W(4,1043794074,1047525730,1014973676,1016237906)+W(5,1003743696,1022650220,-1152923833,-1113356328)+W(6,1003188992,1041338676,-1158035650,1020087968)+W(7,1011818344,-1129296549,-1105090874,-1123006886)+W(8,1021501454,1017537464,-1131940021,-1111245491)+W(9,-1134903850,1033269727,1018262350,-1137051446)+W(10,1034851396,-1106365430,-1104724635,-1123217223)+W(11,-1133259176,1019937714,1024945328,-1117639196);WS(-1077057896,-1083600334);
sum1=W(0,1011471785,1019976613,1014201033,1017420011)+W(1,-1116040414,1015478313,-1126437509,1029223422)+W(2,1016511669,-1167731667,1024110818,1017123181)+W(3,-1138042285,1040273597,999765850,1017846781)+W(4,-1103217262,-1087230893,-1090770241,1049638570)+W(5,1009386661,1023090125,1030676769,1023111893)+W(6,1016487629,1027730222,985808522,-1162024122)+W(7,1046437488,1024768280,1037672698,1029091694)+W(8,1020460717,1025489318,-1120839802,-1112046985)+W(9,1010855969,1025127228,1011766057,1019153993)+W(10,1028909230,1017109109,1025680213,1027546578)+W(11,-1134545259,1027741830,-1128064723,1023955584);sum2=W(0,-1107003878,1013240776,-1152708847,1023774756)+W(1,-1118294055,-1128830540,-1108605887,1020767940)+W(2,1021408408,-1119578529,-1139588328,-1113997093)+W(3,-1108761818,1032847770,-1128030280,1005727232)+W(4,-1097736561,1008347200,1058054639,1050907301)+W(5,-1135972104,-1131826954,1039669350,1032528025)+W(6,1024878510,-1129071264,-1116453887,1004577664)+W(7,1049418167,-1105809360,1040942692,-1106188814)+W(8,999382680,1019392776,-1104688291,-1108856812)+W(9,-1124253692,-1114566712,-1127775332,1020705336)+W(10,1014050712,-1132221182,1042743894,-1115446820)+W(11,-1117167612,1022204104,-1103534695,1018266740);WS(1034686080,-1080904524);
sum1=W(0,1025190657,1024127465,-1156631187,-1139332721)+W(1,1041601261,1028605547,1040892278,-1143163562)+W(2,-1137907141,1012089369,-1129308018,1024768205)+W(3,1006799241,-1145135178,1011454089,1023562901)+W(4,1052908885,-1091833281,-1089193318,-1104914606)+W(5,1019594656,-1143330794,1036300940,-1117860929)+W(6,-1129417722,1017495114,1012327853,1009225011)+W(7,-1103073573,1025246703,-1119873834,1043909393)+W(8,992909011,-1123933213,1033652713,1040987970)+W(9,1027561839,1010795083,1010798725,1010687981)+W(10,-1124345098,1032670633,-1118482716,-1136185891)+W(11,1018355139,-1123266333,1027144528,1024209623);sum2=W(0,-1124228589,1028193069,-1136847690,998154484)+W(1,-1115676434,-1123302060,-1123281782,-1132108902)+W(2,1004957466,1011392625,-1132306691,-1123985162)+W(3,1043298286,-1115567961,-1145824866,-1120010648)+W(4,1027211577,1034703777,1059221182,-1097765474)+W(5,-1127542967,1022587458,-1131429597,-1114822183)+W(6,-1106126812,-1111174068,994166396,1015307650)+W(7,-1099334080,1015056080,-1130476352,1048600788)+W(8,-1127163397,-1122559367,1023836215,1029215805)+W(9,-1128437454,-1110538383,1010815409,1000606426)+W(10,-1137618020,1028199647,-1118584150,1026255089)+W(11,-1171736302,-1124423270,1025007180,-1127893362);WS(-1097173920,-1100403112);
sum1=W(0,-1126599342,-1134319356,-1124511038,-1133792968)+W(1,-1109988694,-1122054529,-1112479512,1026626987)+W(2,-1124691470,-1131431128,-1138055228,-1128510918)+W(3,-1113753548,-1113718896,-1126404688,-1133667884)+W(4,-1097159959,1058630415,1058852431,1051379210)+W(5,-1128464692,-1122909907,-1108453759,1031366423)+W(6,1034489098,1017816566,-1123548289,-1129657589)+W(7,1049904553,-1104990865,1007326848,-1097104011)+W(8,1006087192,-1138955724,-1129654222,-1111244112)+W(9,-1122628437,1029275393,-1120375479,-1134226372)+W(10,983139170,-1110311540,-1116837058,-1112737379)+W(11,-1123473736,-1149064600,-1132471000,-1143321192);sum2=W(0,-1145103116,1024883426,-1170659932,-1133003813)+W(1,1033080040,1028547885,-1117429423,-1105221269)+W(2,-1129731365,-1147341896,-1128891234,1016862101)+W(3,-1122208183,-1101651786,1031055883,1006656308)+W(4,1042272545,1058321046,1055658740,-1098340061)+W(5,-1121650606,1031708925,-1100689547,-1121562483)+W(6,-1107240567,-1137951645,-1138148825,-1122785076)+W(7,-1112738821,1003752088,-1131811521,1035604404)+W(8,-1123396988,-1133076983,1026865631,-1115182870)+W(9,-1131665157,-1116779622,-1131089901,-1134424500)+W(10,1015669581,1033205575,-1123356625,-1130287800)+W(11,-1131162259,-1127933595,-1134576021,-1129373191);WS(1049422752,1064394145);
sum1=W(0,-1106085006,-1123841888,997641734,1016583527)+W(1,1042273115,1021597381,1031369872,995307718)+W(2,1025810280,1006187755,-1122854832,-1113049442)+W(3,1041111742,1032245856,-1131677043,-1129211865)+W(4,1058826428,-1105331685,-1098988005,-1088517333)+W(5,1019889767,-1131685097,1032610296,-1113933244)+W(6,-1110939130,-1105269375,1021691141,1021172552)+W(7,-1090507155,1043687978,1030057089,1058612208)+W(8,-1155049030,-1134096210,-1122591528,1037338632)+W(9,-1137128282,-1106745812,1026669144,-1133007562)+W(10,-1120823228,1038691348,1034516890,1036830720)+W(11,1025994697,-1126546729,-1117945591,-1116248270);sum2=W(0,-1138201662,-1140877219,-1124041461,1015668141)+W(1,-1127284815,-1123578506,-1116450062,-1111996311)+W(2,1020174885,-1139064970,1024732308,-1125087482)+W(3,1027346708,1016303395,1015274173,1005775275)+W(4,-1106280325,1052974100,-1108948194,-1125910350)+W(5,-1133423524,-1161498797,1032925063,1034158307)+W(6,-1106503093,-1117618841,992639399,-1138139200)+W(7,1053021197,957951850,1031763952,-1104963655)+W(8,-1134898868,1013272790,994113735,-1107449032)+W(9,-1115775134,-1122071744,-1129319398,-1132053353)+W(10,1016609913,-1140595900,1034411590,1015724405)+W(11,-1132485274,-1164791981,-1140186580,-1132927280);WS(-1101497152,-1084603877);
sum1=W(0,1016522037,-1157845066,-1140218249,-1136425045)+W(1,1019848413,-1119357636,1029505522,967194407)+W(2,-1142614610,-1135395837,-1140249161,-1129523533)+W(3,1035402982,1027884002,-1122160667,-1121565262)+W(4,1027088345,1024422013,-1107598171,1022903246)+W(5,-1148904362,1002411186,-1127296803,-1121932442)+W(6,1025282390,1022271101,-1132497425,1006883159)+W(7,-1117602990,1030415880,-1120772739,1025270942)+W(8,-1130529549,1018540973,-1129818261,1030372258)+W(9,-1138792353,995143101,-1128604789,1004502690)+W(10,-1171556244,1025955498,-1128284203,-1154700189)+W(11,-1138856043,1011955033,-1121511513,-1138666305);sum2=W(0,-1131366283,-1117612139,-1137964827,-1126668299)+W(1,1000957181,-1119890411,1034620123,1024971228)+W(2,1005199725,-1136862175,-1145021381,-1151515419)+W(3,-1097765254,-1083955387,1030757650,1015963121)+W(4,1026062254,-1107214224,1064229708,1049249869)+W(5,1007955643,-1125717658,1026637176,1001872029)+W(6,-1103492737,-1118797430,997720155,-1137547503)+W(7,-1122275403,1016072153,1017921725,1047078464)+W(8,-1169614250,923654805,-1135832789,1027173860)+W(9,-1131387718,-1140632131,-1152589275,-1132279825)+W(10,-1133941049,996433547,-1144191965,1024786888)+W(11,1002011725,1005736109,-1140699475,-1148432117);WS(1059552336,-1136539026);
sum1=W(0,1041343484,1036710283,1010957914,990367896)+W(1,1033353841,1029016441,-1107358947,-1096612504)+W(2,1028944863,1024290996,-1132821402,-1125599349)+W(3,1045269292,-1112141659,1017372383,-1154541352)+W(4,1042554433,1029783110,1058232297,-1087221074)+W(5,1023892422,1023410731,-1114120867,-1154580200)+W(6,-1116984235,1018013925,1015461809,1026284586)+W(7,-1087458720,-1095293300,1047713030,1051438086)+W(8,-1144215764,-1144750420,1032365167,1033522371)+W(9,1006339428,1032228520,1021777309,1014364322)+W(10,-1114380761,-1099415088,1045851190,1032067931)+W(11,1001346936,-1130073781,1030006574,1004597796);sum2=W(0,-1101809160,-1115520194,-1126180245,-1153914788)+W(1,1046574229,1000424166,1022007580,1052877341)+W(2,1023520281,1021218858,-1113807813,-1095334336)+W(3,-1114410922,1033573989,-1141303142,995844276)+W(4,1034680258,-1098051352,-1098900400,1055965696)+W(5,1008634443,-1115608949,1033797491,-1109583292)+W(6,998799030,-1110191966,990856044,1026951758)+W(7,1045079279,-1106708743,1023185808,1023481081)+W(8,1032307290,-1128938562,1025876178,1032986287)+W(9,-1129252703,1016759632,1015235936,1004850742)+W(10,984863273,-1103050031,-1104219784,1031073312)+W(11,1017335440,1020607644,1038371038,-1137844345);WS(-1080660584,-1085825159);
sum1=W(0,-1123370319,-1131079022,998525366,1013708199)+W(1,-1118786339,1035331132,-1111041043,-1145658646)+W(2,-1144908790,-1131113128,1017605134,1028171867)+W(3,-1110742584,-1113918027,1009982783,1026247587)+W(4,-1095527502,1041941518,1038280501,1047524760)+W(5,-1130744068,992723116,-1110999603,1042485668)+W(6,1032009669,1025751155,-1128223794,-1136883881)+W(7,1051037928,-1106649743,1042402294,-1096311074)+W(8,1025830203,1017749654,-1132447358,-1106204846)+W(9,-1126831290,1033490448,-1126850910,999596614)+W(10,1032615945,-1111971999,1023947050,-1118872454)+W(11,-1127230527,1018668086,971034337,1002160934);sum2=W(0,1017543700,1002138986,-1145776834,988660617)+W(1,-1133704409,1024621822,1001599498,1015794522)+W(2,-1140119133,-1136500105,-1135257421,1003471274)+W(3,1031822055,1032911160,-1126488793,-1133422913)+W(4,-1102581932,-1089051586,1056510750,1041494739)+W(5,-1163479081,1009057465,1026713544,970658596)+W(6,1018658069,1007351961,999055930,999416722)+W(7,-1111744235,1009295285,-1138508317,1023998101)+W(8,1000517690,-1137960905,998080468,945757471)+W(9,-1162261577,999395634,-1179419172,987033481)+W(10,-1140892226,-1147317506,-1141702058,991201876)+W(11,-1186683976,-1146609818,1007988669,-1156050276);WS(1064784784,-1120346387);
sum1=W(0,1015721531,-1110077251,1000581420,-1150678408)+W(1,-1099108228,-1107416484,1043607805,1049255678)+W(2,-1136953142,-1140022794,1017163947,-1149551256)+W(3,-1107299655,-1132691862,1015088861,1006062348)+W(4,-1089544734,-1130977491,-1123916922,1059242626)+W(5,-1139533474,1012221798,1022505321,1023526494)+W(6,-1148196556,1013224070,-1126533711,-1136518116)+W(7,1057929313,1048500643,-1100407642,-1096371932)+W(8,1014035238,1026165050,-1111675367,-1104456865)+W(9,-1124886999,1014270588,-1122704190,1012432222)+W(10,1035479729,1044504531,-1102354822,-1132580564)+W(11,-1136458552,1017479699,1007459698,-1127245287);sum2=W(0,1031694512,-1122230843,-1125513054,-1140771860)+W(1,-1115570202,1042093481,993388690,-1104948969)+W(2,-1127298441,995262946,-1111499166,1040745971)+W(3,979286214,1025077104,-1131288705,-1131667695)+W(4,1042830623,-1112764939,-1111209187,1026183534)+W(5,1002124441,-1123012516,982469091,-1119680402)+W(6,-1108853537,-1102087836,1012596136,978159878)+W(7,1043422569,1034771561,1045410736,1041617383)+W(8,-1129740789,-1125016939,-1109907689,-1120447085)+W(9,-1117751010,-1113389694,-1121534607,1011933560)+W(10,1014235016,1025820984,1044425994,1030126174)+W(11,1004566649,-1119639931,-1115100280,-1127258987);WS(-1088649680,1067112300);
return clamp(mstd0 + 5.0 * vsum / wsum * mstd1, 0.0, 1.0);
}  // nnedi3
vec4 hook() {
vec4 ret = vec4(0.0);
vec4 samples[12];
samples[0] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-3, -2), 0);
samples[1] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-3, 0), 0);
samples[2] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-3, 2), 0);
samples[3] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-1, -2), 0);
samples[4] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-1, 0), 0);
samples[5] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-1, 2), 0);
samples[6] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(1, -2), 0);
samples[7] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(1, 0), 0);
samples[8] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(1, 2), 0);
samples[9] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(3, -2), 0);
samples[10] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(3, 0), 0);
samples[11] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(3, 2), 0);
ret[0] = nnedi3(samples);
return ret;
}  // hook
//!DESC NNEDI3 (combine_y, nns16, win8x6)
//!HOOK LUMA
//!BIND HOOKED
//!BIND nnedi3_int
//!HEIGHT 2 HOOKED.h *
//!OFFSET 0.000000 -0.500000
//!WHEN HOOKED.h OUTPUT.h / 0.833333 <
vec4 hook() {
    vec2 dir = fract(HOOKED_pos * HOOKED_size) - 0.5;
    if (dir.y < 0.0) {
        return HOOKED_texOff(-dir);
    } else {
        return nnedi3_int_texOff(-dir);
    }
}
//!DESC NNEDI3 (double_x, nns16, win8x6)
//!HOOK LUMA
//!BIND HOOKED
//!SAVE nnedi3_int
//!WHEN HOOKED.w OUTPUT.w / 0.833333 <
float nnedi3(vec4 samples[12]) {
float sum = 0.0, sumsq = 0.0;
for (int i = 0; i < 12; i++) {
    sum += dot(samples[i], vec4(1.0));
    sumsq += dot(samples[i], samples[i]);
}
float mstd0 = sum / 48.0;
float mstd1 = sumsq / 48.0 - mstd0 * mstd0;
float mstd2 = mix(0.0, inversesqrt(mstd1), mstd1 >= 1.192092896e-7);
mstd1 *= mstd2;
float vsum = 0.0, wsum = 0.0, sum1, sum2;
#define T(x) intBitsToFloat(x)
#define W(i,w0,w1,w2,w3) dot(samples[i],vec4(T(w0),T(w1),T(w2),T(w3)))
#define WS(w0,w1) sum1 = exp(sum1 * mstd2 + T(w0)); sum2 = sum2 * mstd2 + T(w1); wsum += sum1; vsum += sum1*(sum2/(1.0+abs(sum2)));
sum1=W(0,-1130469888,-1121396864,1027745880,-1126897990)+W(1,-1116173177,1042195560,1041026790,-1113607518)+W(2,-1133977224,1026239260,1018714920,1015526727)+W(3,-1122292152,1015308851,-1131068140,990390561)+W(4,1039079928,-1107295041,1024642508,1024250604)+W(5,-1098313415,999141354,1044630722,1022159130)+W(6,-1106606352,1038936227,-1106681307,1042189511)+W(7,-1122039043,1031978820,-1122507740,1013770942)+W(8,-1147395201,-1126556538,-1149906049,-1121959908)+W(9,1019497054,1007702352,1005058137,-1107136294)+W(10,-1124106064,1025050132,-1121374916,1035880216)+W(11,-1116330759,1018900008,-1135809122,-1136584888);sum2=W(0,1023321012,1029416248,1011515348,1017133506)+W(1,-1112177411,1071604647,1057587887,-1119553894)+W(2,-1133574805,1035052104,1051025857,-1165256880)+W(3,-1135761830,1018728192,1010374724,1020043526)+W(4,-1115999672,1020129658,-1123730089,-1139818306)+W(5,-1079392139,-1097028615,-1109933138,-1090489276)+W(6,-1139515542,-1135392452,-1105405946,-1098617840)+W(7,1024878156,1002597928,-1142174380,-1121583660)+W(8,1015618084,1007066512,-1138856554,996184056)+W(9,1028448562,1008681896,-1145378916,1016266760)+W(10,-1138601606,991053648,1000343320,-1155286464)+W(11,-1131188096,-1132781834,-1155288808,997185888);WS(1018288640,1027735986);
sum1=W(0,1006778572,-1114624234,-1178449286,1012158232)+W(1,-1156175041,1028919475,-1104570115,1025063871)+W(2,-1140348884,-1127457566,1034856692,1010747802)+W(3,-1172026051,-1115773453,-1122825993,1020162890)+W(4,1032943202,1027108853,-1128542910,1044498160)+W(5,-1097612337,-1106124541,-1088743921,1059928494)+W(6,1031833306,1032056909,1059914122,-1085331503)+W(7,1038136595,1027508251,1033999672,-1119592595)+W(8,1017365062,964628492,1002517720,-1115962871)+W(9,1026836706,-1146238776,-1134936888,1032615126)+W(10,-1122073627,1016604174,1020458158,-1114177498)+W(11,-1129465364,1023799671,998219705,1022377282);sum2=W(0,-1145399745,985194115,-1130460798,-1126840972)+W(1,991527106,-1120456092,-1112997847,-1139273136)+W(2,-1139461992,1017866680,1001121889,-1135317632)+W(3,995542402,1000306721,1006765920,-1129486378)+W(4,-1120812206,-1129997452,1017322604,1019075916)+W(5,1043975251,1051048254,1042717692,-1139625904)+W(6,-1128878392,-1112673669,-1121880440,-1150833602)+W(7,-1142139489,-1114488494,-1126929736,-1133504840)+W(8,1006903064,-1143360737,-1131047996,-1131054760)+W(9,-1113881740,1007107280,-1130986946,-1114175000)+W(10,1026044394,-1125685806,-1143215153,978663174)+W(11,1007041936,-1134951296,-1144361281,1014584312);WS(1042433344,-1111851638);
sum1=W(0,-1139940268,-1123380939,-1112658226,-1128612156)+W(1,984858240,-1107767030,-1128727592,-1122042583)+W(2,-1146630760,-1115281716,-1114896432,999630836)+W(3,996431920,-1123547845,-1129996802,-1126512698)+W(4,-1126908022,1033805831,1043958886,-1119638967)+W(5,1052387104,1046318672,1057665642,-1097703246)+W(6,1030603948,-1117224401,-1095395475,1054789077)+W(7,1026334318,-1113258842,-1123618471,1028419819)+W(8,-1115346894,-1142120768,-1128976934,-1120465263)+W(9,-1108167869,-1148354296,1005565040,-1104545545)+W(10,-1163176544,-1117808895,-1133849404,1029397739)+W(11,-1134051464,-1120421311,1013349902,-1117439993);sum2=W(0,-1132240188,-1119299282,-1109389142,1022431497)+W(1,-1114822837,1044244351,-1107432916,1024165374)+W(2,-1124855948,983982854,1031006195,-1120729932)+W(3,-1128289576,-1121099750,-1158996358,-1126342960)+W(4,-1139248009,-1129989652,1028727631,1004613154)+W(5,-1108646182,-1100679909,1047487962,1041447926)+W(6,1009435309,1033956847,-1126089152,1047688354)+W(7,1036127241,1039673953,-1123334894,-1122846542)+W(8,-1140046689,-1114039002,-1132574761,1029503922)+W(9,1040665470,-1123756570,-1135952741,1017218352)+W(10,-1107003694,1028342876,-1148002498,-1120804126)+W(11,-1102421772,1026336008,-1117057946,-1140927562);WS(1015433728,1058400049);
sum1=W(0,-1133909491,1032977294,1031161269,-1139873791)+W(1,-1230944644,1035249566,-1116372870,1023506921)+W(2,1028378783,-1114963068,-1120831281,-1118840528)+W(3,1033465034,-1105610222,1032892305,-1121050287)+W(4,-1112917766,-1131731326,1033801204,-1113693508)+W(5,-1103376612,-1102794347,1045725159,-1116140698)+W(6,-1141442286,1032646513,-1116748777,1044830734)+W(7,1034039600,1030129285,-1112562780,1023234585)+W(8,989007258,1019358132,-1143910182,-1119172737)+W(9,1044071755,-1115540344,1008313039,-1122523445)+W(10,1018738506,-1118552369,-1126204226,1030473357)+W(11,-1122899972,-1124368226,1016154651,1021910870);sum2=W(0,992976916,1013039401,-1158711528,-1138428449)+W(1,976851025,1036130613,-1128734961,-1142924106)+W(2,997652548,-1137359275,1010050489,989093448)+W(3,-1134977059,-1138876101,990210276,-1153131756)+W(4,-1130455464,-1123518198,-1140697417,-1124467432)+W(5,-1097860430,-1077268149,-1099387353,-1113146735)+W(6,-1122996798,1032494444,-1091225653,-1108810723)+W(7,-1127238416,1018469149,-1115493835,-1140348735)+W(8,1033499227,975746961,1012442941,1030243467)+W(9,1072898808,-1117904739,-1122081826,1051222006)+W(10,1025590581,951236744,-1131990027,1056060393)+W(11,1026307569,-1146863422,1006284898,1025171621);WS(-1143089152,1030017260);
sum1=W(0,1001605962,-1127223379,-1116644609,1012276081)+W(1,-1155861797,-1115433381,-1109637089,1024406997)+W(2,-1122534699,1028189701,1036571679,-1155627981)+W(3,-1120990241,1036379833,-1126280255,1018348791)+W(4,-1119160665,1035777366,-1124688427,1019444907)+W(5,1044433671,1006101820,-1098625404,1048989101)+W(6,1039597237,-1104960796,1048780603,-1098184025)+W(7,-1136463217,-1111599465,1029641477,-1117935161)+W(8,-1136557285,-1130309965,-1130860131,1029853709)+W(9,-1111190908,1009046005,-1130883561,1038057505)+W(10,-1130076067,1018788475,1025361773,-1112291813)+W(11,-1154886405,1020397819,-1125993892,1012573277);sum2=W(0,-1147284080,985822624,1008405084,-1153319600)+W(1,995456320,1022276922,-1142311064,1008968960)+W(2,-1146954776,1005012008,-1140411728,-1140178660)+W(3,-1170856127,1006946188,1003782736,-1142030464)+W(4,1010505984,-1129308604,-1140784820,-1118973116)+W(5,-1089187936,1057794596,1037448945,-1101248908)+W(6,1017518401,1015531414,1029773785,-1109859050)+W(7,995727232,960534268,974134143,982409184)+W(8,1021293048,1001814848,1010769460,1012585128)+W(9,1033366347,-1123619202,-1160749952,1024969278)+W(10,1007802556,1000322872,-1136545168,1024400778)+W(11,1009923956,985284128,-1152799248,1003482728);WS(1064472528,-1121594920);
sum1=W(0,-1143599223,1032290711,1027230343,-1142654991)+W(1,1010500896,1002050167,-1136037408,1014568428)+W(2,1020884834,-1120250507,-1122938499,-1124387333)+W(3,1026841191,-1110863224,1025589157,-1131205634)+W(4,-1113392623,1016010466,1027061019,-1112807213)+W(5,-1113734161,-1112872467,1034098395,-1115590690)+W(6,1029912912,1015162858,-1130883382,1038834309)+W(7,1031947569,1019435182,-1123484555,1019867389)+W(8,991342574,1014490160,-1164359388,-1128825126)+W(9,1027642302,-1127829894,-1148094031,1008695068)+W(10,1015817710,-1124941766,-1138058188,1013984188)+W(11,-1129521612,-1130075526,1008886302,1015459258);sum2=W(0,-1147429191,-1139843175,-1154115373,1003807591)+W(1,-1132089351,1016729308,1018649088,1002635095)+W(2,-1151072125,-1155997437,1024344696,-1147602519)+W(3,1011860423,-1141691791,1001714367,964968041)+W(4,1001833687,1024488826,1017182228,1000124719)+W(5,-1105992985,1063780536,1040714709,1008095031)+W(6,-1132427785,1020609216,1047200342,1014141127)+W(7,-1139390003,1017456200,1023684454,-1141957575)+W(8,-1116401990,987658746,-1130234859,-1126980607)+W(9,-1085442794,1024604622,1013729967,-1105844805)+W(10,-1122913939,-1147894927,995366957,-1101306502)+W(11,-1128761080,-1146063807,-1146690231,-1125194898);WS(1061878800,-1131153991);
sum1=W(0,1018625288,1031144036,1015115512,-1123872727)+W(1,1026350045,-1108974562,1036357847,-1127640224)+W(2,1018183052,1006433282,-1107191102,1013916191)+W(3,1016048056,1026198990,1014427177,-1145362866)+W(4,-1102371221,1009910425,1041224340,-1099302516)+W(5,1059569738,1058525661,1052022073,-1085394744)+W(6,1032504563,-1097316565,-1088226291,1050617832)+W(7,1033421596,-1098228398,-1109508096,1031877738)+W(8,1014687697,1022902338,-1171049230,-1144166978)+W(9,-1125187302,1016189168,-1132534141,-1115552350)+W(10,1040234099,-1127405808,-1123531112,1037730450)+W(11,1035235966,-1137247201,1018548825,1015825508);sum2=W(0,973798558,-1131640108,1031269327,-1131301730)+W(1,1013478572,-1109509101,1013454096,-1127780866)+W(2,-1135840779,-1131160392,-1117315078,-1160424319)+W(3,-1138738786,-1127332243,-1145619912,-1164912671)+W(4,1028981651,-1125259759,-1109842974,-1127010401)+W(5,1051779317,1047088883,-1113692773,-1149526184)+W(6,-1137527992,1028175261,-1134194124,1028380081)+W(7,-1148504424,1027237057,1018886164,998238336)+W(8,-1167651134,-1160957999,-1180777340,-1181736700)+W(9,-1109788940,1020962386,993986728,-1123287814)+W(10,-1121515979,-1138138790,-1136947718,-1115287133)+W(11,-1142455024,-1123011340,-1152989064,-1125209194);WS(-1146021888,1053974589);
sum1=W(0,1013890275,-1134074211,-1119368753,1029642476)+W(1,1022266947,1017736689,1007708103,-1176939092)+W(2,1004183253,1032510570,1027345005,-1146466657)+W(3,-1127783457,1031489314,1019378973,-1160650069)+W(4,1042359026,-1107285127,-1095098901,1042969521)+W(5,-1101301107,1034918881,-1096985546,1045769551)+W(6,-1091538585,1051699648,1050538529,-1094644679)+W(7,-1095508207,1048776768,1036824506,-1107179580)+W(8,1031018217,-1135393367,984849429,1046685039)+W(9,1003810877,1024875117,-1139413615,1036262392)+W(10,1011534979,1017671961,-1172526890,-1120828825)+W(11,1035618600,1006585957,-1160823333,-1133351451);sum2=W(0,1030774484,1001500224,-1091101506,1031363252)+W(1,1007437656,965388167,-1110787951,1015165558)+W(2,-1158035650,1041338676,1003188992,1020087968)+W(3,1018262350,1033269727,-1134903850,-1137051446)+W(4,-1110436898,-1132290932,1057852755,1048232756)+W(5,1014973676,1047525730,1043794074,1016237906)+W(6,-1105090874,-1129296549,1011818344,-1123006886)+W(7,-1104724635,-1106365430,1034851396,-1123217223)+W(8,-1131305343,-1126601761,1016290300,-1095952784)+W(9,-1152923833,1022650220,1003743696,-1113356328)+W(10,-1131940021,1017537464,1021501454,-1111245491)+W(11,1024945328,1019937714,-1133259176,-1117639196);WS(-1077057896,-1083600334);
sum1=W(0,1014201033,1019976613,1011471785,1017420011)+W(1,999765850,1040273597,-1138042285,1017846781)+W(2,985808522,1027730222,1016487629,-1162024122)+W(3,1011766057,1025127228,1010855969,1019153993)+W(4,-1126437509,1015478313,-1116040414,1029223422)+W(5,-1090770241,-1087230893,-1103217262,1049638570)+W(6,1037672698,1024768280,1046437488,1029091694)+W(7,1025680213,1017109109,1028909230,1027546578)+W(8,1024110818,-1167731667,1016511669,1017123181)+W(9,1030676769,1023090125,1009386661,1023111893)+W(10,-1120839802,1025489318,1020460717,-1112046985)+W(11,-1128064723,1027741830,-1134545259,1023955584);sum2=W(0,-1152708847,1013240776,-1107003878,1023774756)+W(1,-1128030280,1032847770,-1108761818,1005727232)+W(2,-1116453887,-1129071264,1024878510,1004577664)+W(3,-1127775332,-1114566712,-1124253692,1020705336)+W(4,-1108605887,-1128830540,-1118294055,1020767940)+W(5,1058054639,1008347200,-1097736561,1050907301)+W(6,1040942692,-1105809360,1049418167,-1106188814)+W(7,1042743894,-1132221182,1014050712,-1115446820)+W(8,-1139588328,-1119578529,1021408408,-1113997093)+W(9,1039669350,-1131826954,-1135972104,1032528025)+W(10,-1104688291,1019392776,999382680,-1108856812)+W(11,-1103534695,1022204104,-1117167612,1018266740);WS(1034686080,-1080904524);
sum1=W(0,-1156631187,1024127465,1025190657,-1139332721)+W(1,1011454089,-1145135178,1006799241,1023562901)+W(2,1012327853,1017495114,-1129417722,1009225011)+W(3,1010798725,1010795083,1027561839,1010687981)+W(4,1040892278,1028605547,1041601261,-1143163562)+W(5,-1089193318,-1091833281,1052908885,-1104914606)+W(6,-1119873834,1025246703,-1103073573,1043909393)+W(7,-1118482716,1032670633,-1124345098,-1136185891)+W(8,-1129308018,1012089369,-1137907141,1024768205)+W(9,1036300940,-1143330794,1019594656,-1117860929)+W(10,1033652713,-1123933213,992909011,1040987970)+W(11,1027144528,-1123266333,1018355139,1024209623);sum2=W(0,-1136847690,1028193069,-1124228589,998154484)+W(1,-1145824866,-1115567961,1043298286,-1120010648)+W(2,994166396,-1111174068,-1106126812,1015307650)+W(3,1010815409,-1110538383,-1128437454,1000606426)+W(4,-1123281782,-1123302060,-1115676434,-1132108902)+W(5,1059221182,1034703777,1027211577,-1097765474)+W(6,-1130476352,1015056080,-1099334080,1048600788)+W(7,-1118584150,1028199647,-1137618020,1026255089)+W(8,-1132306691,1011392625,1004957466,-1123985162)+W(9,-1131429597,1022587458,-1127542967,-1114822183)+W(10,1023836215,-1122559367,-1127163397,1029215805)+W(11,1025007180,-1124423270,-1171736302,-1127893362);WS(-1097173920,-1100403112);
sum1=W(0,-1124511038,-1134319356,-1126599342,-1133792968)+W(1,-1126404688,-1113718896,-1113753548,-1133667884)+W(2,-1123548289,1017816566,1034489098,-1129657589)+W(3,-1120375479,1029275393,-1122628437,-1134226372)+W(4,-1112479512,-1122054529,-1109988694,1026626987)+W(5,1058852431,1058630415,-1097159959,1051379210)+W(6,1007326848,-1104990865,1049904553,-1097104011)+W(7,-1116837058,-1110311540,983139170,-1112737379)+W(8,-1138055228,-1131431128,-1124691470,-1128510918)+W(9,-1108453759,-1122909907,-1128464692,1031366423)+W(10,-1129654222,-1138955724,1006087192,-1111244112)+W(11,-1132471000,-1149064600,-1123473736,-1143321192);sum2=W(0,-1170659932,1024883426,-1145103116,-1133003813)+W(1,1031055883,-1101651786,-1122208183,1006656308)+W(2,-1138148825,-1137951645,-1107240567,-1122785076)+W(3,-1131089901,-1116779622,-1131665157,-1134424500)+W(4,-1117429423,1028547885,1033080040,-1105221269)+W(5,1055658740,1058321046,1042272545,-1098340061)+W(6,-1131811521,1003752088,-1112738821,1035604404)+W(7,-1123356625,1033205575,1015669581,-1130287800)+W(8,-1128891234,-1147341896,-1129731365,1016862101)+W(9,-1100689547,1031708925,-1121650606,-1121562483)+W(10,1026865631,-1133076983,-1123396988,-1115182870)+W(11,-1134576021,-1127933595,-1131162259,-1129373191);WS(1049422752,1064394145);
sum1=W(0,997641734,-1123841888,-1106085006,1016583527)+W(1,-1131677043,1032245856,1041111742,-1129211865)+W(2,1021691141,-1105269375,-1110939130,1021172552)+W(3,1026669144,-1106745812,-1137128282,-1133007562)+W(4,1031369872,1021597381,1042273115,995307718)+W(5,-1098988005,-1105331685,1058826428,-1088517333)+W(6,1030057089,1043687978,-1090507155,1058612208)+W(7,1034516890,1038691348,-1120823228,1036830720)+W(8,-1122854832,1006187755,1025810280,-1113049442)+W(9,1032610296,-1131685097,1019889767,-1113933244)+W(10,-1122591528,-1134096210,-1155049030,1037338632)+W(11,-1117945591,-1126546729,1025994697,-1116248270);sum2=W(0,-1124041461,-1140877219,-1138201662,1015668141)+W(1,1015274173,1016303395,1027346708,1005775275)+W(2,992639399,-1117618841,-1106503093,-1138139200)+W(3,-1129319398,-1122071744,-1115775134,-1132053353)+W(4,-1116450062,-1123578506,-1127284815,-1111996311)+W(5,-1108948194,1052974100,-1106280325,-1125910350)+W(6,1031763952,957951850,1053021197,-1104963655)+W(7,1034411590,-1140595900,1016609913,1015724405)+W(8,1024732308,-1139064970,1020174885,-1125087482)+W(9,1032925063,-1161498797,-1133423524,1034158307)+W(10,994113735,1013272790,-1134898868,-1107449032)+W(11,-1140186580,-1164791981,-1132485274,-1132927280);WS(-1101497152,-1084603877);
sum1=W(0,-1140218249,-1157845066,1016522037,-1136425045)+W(1,-1122160667,1027884002,1035402982,-1121565262)+W(2,-1132497425,1022271101,1025282390,1006883159)+W(3,-1128604789,995143101,-1138792353,1004502690)+W(4,1029505522,-1119357636,1019848413,967194407)+W(5,-1107598171,1024422013,1027088345,1022903246)+W(6,-1120772739,1030415880,-1117602990,1025270942)+W(7,-1128284203,1025955498,-1171556244,-1154700189)+W(8,-1140249161,-1135395837,-1142614610,-1129523533)+W(9,-1127296803,1002411186,-1148904362,-1121932442)+W(10,-1129818261,1018540973,-1130529549,1030372258)+W(11,-1121511513,1011955033,-1138856043,-1138666305);sum2=W(0,-1137964827,-1117612139,-1131366283,-1126668299)+W(1,1030757650,-1083955387,-1097765254,1015963121)+W(2,997720155,-1118797430,-1103492737,-1137547503)+W(3,-1152589275,-1140632131,-1131387718,-1132279825)+W(4,1034620123,-1119890411,1000957181,1024971228)+W(5,1064229708,-1107214224,1026062254,1049249869)+W(6,1017921725,1016072153,-1122275403,1047078464)+W(7,-1144191965,996433547,-1133941049,1024786888)+W(8,-1145021381,-1136862175,1005199725,-1151515419)+W(9,1026637176,-1125717658,1007955643,1001872029)+W(10,-1135832789,923654805,-1169614250,1027173860)+W(11,-1140699475,1005736109,1002011725,-1148432117);WS(1059552336,-1136539026);
sum1=W(0,1010957914,1036710283,1041343484,990367896)+W(1,1017372383,-1112141659,1045269292,-1154541352)+W(2,1015461809,1018013925,-1116984235,1026284586)+W(3,1021777309,1032228520,1006339428,1014364322)+W(4,-1107358947,1029016441,1033353841,-1096612504)+W(5,1058232297,1029783110,1042554433,-1087221074)+W(6,1047713030,-1095293300,-1087458720,1051438086)+W(7,1045851190,-1099415088,-1114380761,1032067931)+W(8,-1132821402,1024290996,1028944863,-1125599349)+W(9,-1114120867,1023410731,1023892422,-1154580200)+W(10,1032365167,-1144750420,-1144215764,1033522371)+W(11,1030006574,-1130073781,1001346936,1004597796);sum2=W(0,-1126180245,-1115520194,-1101809160,-1153914788)+W(1,-1141303142,1033573989,-1114410922,995844276)+W(2,990856044,-1110191966,998799030,1026951758)+W(3,1015235936,1016759632,-1129252703,1004850742)+W(4,1022007580,1000424166,1046574229,1052877341)+W(5,-1098900400,-1098051352,1034680258,1055965696)+W(6,1023185808,-1106708743,1045079279,1023481081)+W(7,-1104219784,-1103050031,984863273,1031073312)+W(8,-1113807813,1021218858,1023520281,-1095334336)+W(9,1033797491,-1115608949,1008634443,-1109583292)+W(10,1025876178,-1128938562,1032307290,1032986287)+W(11,1038371038,1020607644,1017335440,-1137844345);WS(-1080660584,-1085825159);
sum1=W(0,998525366,-1131079022,-1123370319,1013708199)+W(1,1009982783,-1113918027,-1110742584,1026247587)+W(2,-1128223794,1025751155,1032009669,-1136883881)+W(3,-1126850910,1033490448,-1126831290,999596614)+W(4,-1111041043,1035331132,-1118786339,-1145658646)+W(5,1038280501,1041941518,-1095527502,1047524760)+W(6,1042402294,-1106649743,1051037928,-1096311074)+W(7,1023947050,-1111971999,1032615945,-1118872454)+W(8,1017605134,-1131113128,-1144908790,1028171867)+W(9,-1110999603,992723116,-1130744068,1042485668)+W(10,-1132447358,1017749654,1025830203,-1106204846)+W(11,971034337,1018668086,-1127230527,1002160934);sum2=W(0,-1145776834,1002138986,1017543700,988660617)+W(1,-1126488793,1032911160,1031822055,-1133422913)+W(2,999055930,1007351961,1018658069,999416722)+W(3,-1179419172,999395634,-1162261577,987033481)+W(4,1001599498,1024621822,-1133704409,1015794522)+W(5,1056510750,-1089051586,-1102581932,1041494739)+W(6,-1138508317,1009295285,-1111744235,1023998101)+W(7,-1141702058,-1147317506,-1140892226,991201876)+W(8,-1135257421,-1136500105,-1140119133,1003471274)+W(9,1026713544,1009057465,-1163479081,970658596)+W(10,998080468,-1137960905,1000517690,945757471)+W(11,1007988669,-1146609818,-1186683976,-1156050276);WS(1064784784,-1120346387);
sum1=W(0,1000581420,-1110077251,1015721531,-1150678408)+W(1,1015088861,-1132691862,-1107299655,1006062348)+W(2,-1126533711,1013224070,-1148196556,-1136518116)+W(3,-1122704190,1014270588,-1124886999,1012432222)+W(4,1043607805,-1107416484,-1099108228,1049255678)+W(5,-1123916922,-1130977491,-1089544734,1059242626)+W(6,-1100407642,1048500643,1057929313,-1096371932)+W(7,-1102354822,1044504531,1035479729,-1132580564)+W(8,1017163947,-1140022794,-1136953142,-1149551256)+W(9,1022505321,1012221798,-1139533474,1023526494)+W(10,-1111675367,1026165050,1014035238,-1104456865)+W(11,1007459698,1017479699,-1136458552,-1127245287);sum2=W(0,-1125513054,-1122230843,1031694512,-1140771860)+W(1,-1131288705,1025077104,979286214,-1131667695)+W(2,1012596136,-1102087836,-1108853537,978159878)+W(3,-1121534607,-1113389694,-1117751010,1011933560)+W(4,993388690,1042093481,-1115570202,-1104948969)+W(5,-1111209187,-1112764939,1042830623,1026183534)+W(6,1045410736,1034771561,1043422569,1041617383)+W(7,1044425994,1025820984,1014235016,1030126174)+W(8,-1111499166,995262946,-1127298441,1040745971)+W(9,982469091,-1123012516,1002124441,-1119680402)+W(10,-1109907689,-1125016939,-1129740789,-1120447085)+W(11,-1115100280,-1119639931,1004566649,-1127258987);WS(-1088649680,1067112300);
return clamp(mstd0 + 5.0 * vsum / wsum * mstd1, 0.0, 1.0);
}  // nnedi3
vec4 hook() {
vec4 ret = vec4(0.0);
vec4 samples[12];
samples[0] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-2, -3), 0);
samples[1] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-2, -1), 0);
samples[2] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-2, 1), 0);
samples[3] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(-2, 3), 0);
samples[4] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(0, -3), 0);
samples[5] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(0, -1), 0);
samples[6] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(0, 1), 0);
samples[7] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(0, 3), 0);
samples[8] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(2, -3), 0);
samples[9] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(2, -1), 0);
samples[10] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(2, 1), 0);
samples[11] = HOOKED_mul * textureGatherOffset(HOOKED_raw, HOOKED_pos, ivec2(2, 3), 0);
ret[0] = nnedi3(samples);
return ret;
}  // hook
//!DESC NNEDI3 (combine_x, nns16, win8x6)
//!HOOK LUMA
//!BIND HOOKED
//!BIND nnedi3_int
//!WIDTH 2 HOOKED.w *
//!OFFSET -0.500000 0.000000
//!WHEN HOOKED.w OUTPUT.w / 0.833333 <
vec4 hook() {
    vec2 dir = fract(HOOKED_pos * HOOKED_size) - 0.5;
    if (dir.x < 0.0) {
        return HOOKED_texOff(-dir);
    } else {
        return nnedi3_int_texOff(-dir);
    }
}
